import  {SiteUrl}  from "./Config.js";

export default {
  data: function() {
    return {
      UserInfo: null,
      token:""
    };
  },
  created: function() {
    if (this.UserInfo == null) {

      var portal_token = localStorage.getItem("portal_token") || "";
      var portal_userinfo = localStorage.getItem("portal_userinfo") || "";

      console.log(portal_token,'portal_token')
      console.log(portal_userinfo,'portal_userinfo')

      if (
        portal_userinfo == "" &&
        this["pageNeedLogin"] &&
        this.pageNeedLogin == true
      ) {
        console.log(SiteUrl);
        console.log(SiteUrl.LoginPageUrl);
        top.window.location.href = "http://"+SiteUrl.LoginPageUrl+"?r=111"
        return false;
      }
      
      portal_userinfo=JSON.parse(portal_userinfo);
      this.UserInfo=portal_userinfo;
      this.token=portal_token;


    }
  },
  methods: {
    sayHello: function() {
      console.log("hello");
    }
  }
};
